Optimal. Leaf size=241 \[ -\frac {\left (f g^2-h (e g-d h)\right ) \sqrt {a+b x+c x^2}}{h \left (c g^2-b g h+a h^2\right ) (g+h x)}+\frac {f \tanh ^{-1}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{\sqrt {c} h^2}-\frac {\left (2 c \left (f g^3-d g h^2\right )+h \left (2 a h (2 f g-e h)-b \left (3 f g^2-e g h-d h^2\right )\right )\right ) \tanh ^{-1}\left (\frac {b g-2 a h+(2 c g-b h) x}{2 \sqrt {c g^2-b g h+a h^2} \sqrt {a+b x+c x^2}}\right )}{2 h^2 \left (c g^2-b g h+a h^2\right )^{3/2}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.22, antiderivative size = 239, normalized size of antiderivative = 0.99, number of steps
used = 6, number of rules used = 5, integrand size = 32, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.156, Rules used = {1664, 857, 635,
212, 738} \begin {gather*} -\frac {\sqrt {a+b x+c x^2} \left (f g^2-h (e g-d h)\right )}{h (g+h x) \left (a h^2-b g h+c g^2\right )}-\frac {\tanh ^{-1}\left (\frac {-2 a h+x (2 c g-b h)+b g}{2 \sqrt {a+b x+c x^2} \sqrt {a h^2-b g h+c g^2}}\right ) \left (2 c \left (f g^3-d g h^2\right )-h \left (-2 a h (2 f g-e h)-b h (d h+e g)+3 b f g^2\right )\right )}{2 h^2 \left (a h^2-b g h+c g^2\right )^{3/2}}+\frac {f \tanh ^{-1}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{\sqrt {c} h^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 635
Rule 738
Rule 857
Rule 1664
Rubi steps
\begin {align*} \int \frac {d+e x+f x^2}{(g+h x)^2 \sqrt {a+b x+c x^2}} \, dx &=-\frac {\left (f g^2-h (e g-d h)\right ) \sqrt {a+b x+c x^2}}{h \left (c g^2-b g h+a h^2\right ) (g+h x)}-\frac {\int \frac {\frac {1}{2} \left (-2 c d g+b e g+2 a f g-\frac {b f g^2}{h}+b d h-2 a e h\right )+f \left (b g-\frac {c g^2}{h}-a h\right ) x}{(g+h x) \sqrt {a+b x+c x^2}} \, dx}{c g^2-b g h+a h^2}\\ &=-\frac {\left (f g^2-h (e g-d h)\right ) \sqrt {a+b x+c x^2}}{h \left (c g^2-b g h+a h^2\right ) (g+h x)}+\frac {f \int \frac {1}{\sqrt {a+b x+c x^2}} \, dx}{h^2}-\frac {\left (2 c \left (f g^3-d g h^2\right )-h \left (3 b f g^2-b h (e g+d h)-2 a h (2 f g-e h)\right )\right ) \int \frac {1}{(g+h x) \sqrt {a+b x+c x^2}} \, dx}{2 h^2 \left (c g^2-b g h+a h^2\right )}\\ &=-\frac {\left (f g^2-h (e g-d h)\right ) \sqrt {a+b x+c x^2}}{h \left (c g^2-b g h+a h^2\right ) (g+h x)}+\frac {(2 f) \text {Subst}\left (\int \frac {1}{4 c-x^2} \, dx,x,\frac {b+2 c x}{\sqrt {a+b x+c x^2}}\right )}{h^2}+\frac {\left (2 c \left (f g^3-d g h^2\right )-h \left (3 b f g^2-b h (e g+d h)-2 a h (2 f g-e h)\right )\right ) \text {Subst}\left (\int \frac {1}{4 c g^2-4 b g h+4 a h^2-x^2} \, dx,x,\frac {-b g+2 a h-(2 c g-b h) x}{\sqrt {a+b x+c x^2}}\right )}{h^2 \left (c g^2-b g h+a h^2\right )}\\ &=-\frac {\left (f g^2-h (e g-d h)\right ) \sqrt {a+b x+c x^2}}{h \left (c g^2-b g h+a h^2\right ) (g+h x)}+\frac {f \tanh ^{-1}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{\sqrt {c} h^2}-\frac {\left (2 c \left (f g^3-d g h^2\right )-h \left (3 b f g^2-b h (e g+d h)-2 a h (2 f g-e h)\right )\right ) \tanh ^{-1}\left (\frac {b g-2 a h+(2 c g-b h) x}{2 \sqrt {c g^2-b g h+a h^2} \sqrt {a+b x+c x^2}}\right )}{2 h^2 \left (c g^2-b g h+a h^2\right )^{3/2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.24, size = 236, normalized size = 0.98 \begin {gather*} -\frac {\frac {h \left (f g^2+h (-e g+d h)\right ) \sqrt {a+x (b+c x)}}{\left (c g^2+h (-b g+a h)\right ) (g+h x)}+\frac {\sqrt {-c g^2+h (b g-a h)} \left (2 c \left (f g^3-d g h^2\right )+h \left (-3 b f g^2+b h (e g+d h)-2 a h (-2 f g+e h)\right )\right ) \tan ^{-1}\left (\frac {\sqrt {c} (g+h x)-h \sqrt {a+x (b+c x)}}{\sqrt {-c g^2+h (b g-a h)}}\right )}{\left (c g^2+h (-b g+a h)\right )^2}+\frac {f \log \left (b+2 c x-2 \sqrt {c} \sqrt {a+x (b+c x)}\right )}{\sqrt {c}}}{h^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(484\) vs.
\(2(221)=442\).
time = 0.13, size = 485, normalized size = 2.01
method | result | size |
default | \(\frac {f \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{h^{2} \sqrt {c}}-\frac {\left (e h -2 g f \right ) \ln \left (\frac {\frac {2 a \,h^{2}-2 b g h +2 c \,g^{2}}{h^{2}}+\frac {\left (b h -2 c g \right ) \left (x +\frac {g}{h}\right )}{h}+2 \sqrt {\frac {a \,h^{2}-b g h +c \,g^{2}}{h^{2}}}\, \sqrt {\left (x +\frac {g}{h}\right )^{2} c +\frac {\left (b h -2 c g \right ) \left (x +\frac {g}{h}\right )}{h}+\frac {a \,h^{2}-b g h +c \,g^{2}}{h^{2}}}}{x +\frac {g}{h}}\right )}{h^{3} \sqrt {\frac {a \,h^{2}-b g h +c \,g^{2}}{h^{2}}}}+\frac {\left (d \,h^{2}-e g h +f \,g^{2}\right ) \left (-\frac {h^{2} \sqrt {\left (x +\frac {g}{h}\right )^{2} c +\frac {\left (b h -2 c g \right ) \left (x +\frac {g}{h}\right )}{h}+\frac {a \,h^{2}-b g h +c \,g^{2}}{h^{2}}}}{\left (a \,h^{2}-b g h +c \,g^{2}\right ) \left (x +\frac {g}{h}\right )}+\frac {\left (b h -2 c g \right ) h \ln \left (\frac {\frac {2 a \,h^{2}-2 b g h +2 c \,g^{2}}{h^{2}}+\frac {\left (b h -2 c g \right ) \left (x +\frac {g}{h}\right )}{h}+2 \sqrt {\frac {a \,h^{2}-b g h +c \,g^{2}}{h^{2}}}\, \sqrt {\left (x +\frac {g}{h}\right )^{2} c +\frac {\left (b h -2 c g \right ) \left (x +\frac {g}{h}\right )}{h}+\frac {a \,h^{2}-b g h +c \,g^{2}}{h^{2}}}}{x +\frac {g}{h}}\right )}{2 \left (a \,h^{2}-b g h +c \,g^{2}\right ) \sqrt {\frac {a \,h^{2}-b g h +c \,g^{2}}{h^{2}}}}\right )}{h^{4}}\) | \(485\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {d + e x + f x^{2}}{\left (g + h x\right )^{2} \sqrt {a + b x + c x^{2}}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: TypeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {f\,x^2+e\,x+d}{{\left (g+h\,x\right )}^2\,\sqrt {c\,x^2+b\,x+a}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________